package com.sky.cqculture.pojo;

public class OrderItem {
    private Integer id;         // 订单项ID
    private Integer orderId;    // 订单ID
    private Integer productId;  // 商品ID
    private Integer quantity;   // 商品数量
    private Double price;       // 商品单价，修改为price与数据库一致
    private String productName; // 商品名称
    
    // 扩展字段
    private Product product;    // 商品信息

    public OrderItem(Integer id, Integer orderId, Integer productId, Integer quantity, Double price, String productName, Product product) {
        this.id = id;
        this.orderId = orderId;
        this.productId = productId;
        this.quantity = quantity;
        this.price = price; // 修改为price
        this.productName = productName;
        this.product = product;
    }

    public String getProductName() {
        return productName;
    }

    public void setProductName(String productName) {
        this.productName = productName;
    }

    // 构造方法
    public OrderItem() {}
    
    public OrderItem(Integer orderId, Integer productId, Integer quantity, Double price) {
        this.orderId = orderId;
        this.productId = productId;
        this.quantity = quantity;
        this.price = price; // 修改为price
    }
    
    // getter和setter方法
    public Integer getId() { return id; }
    public void setId(Integer id) { this.id = id; }
    
    public Integer getOrderId() { return orderId; }
    public void setOrderId(Integer orderId) { this.orderId = orderId; }
    
    public Integer getProductId() { return productId; }
    public void setProductId(Integer productId) { this.productId = productId; }
    
    public Integer getQuantity() { return quantity; }
    public void setQuantity(Integer quantity) { this.quantity = quantity; }
    
    public Double getPrice() { return price; } // 修改为price
    public void setPrice(Double price) { this.price = price; } // 修改为price
    
    public Product getProduct() { return product; }
    public void setProduct(Product product) { this.product = product; }
}